﻿using UnityEngine;
using Unity.Entities;
public class FindTargetAuthoring : MonoBehaviour
{
    public float range;
    public FactionType tagertFaction;
    public float timerMax;
    public class Baker : Baker<FindTargetAuthoring>
    {
        public override void Bake(FindTargetAuthoring authoring)
        {
            Entity entity = GetEntity(TransformUsageFlags.Dynamic);
            AddComponent(entity, new FindTarget
            {
                range = authoring.range,
                tagertFaction = authoring.tagertFaction,
                timerMax = authoring.timerMax
            }
            );
        }
    }
}

public struct FindTarget : IComponentData
{
    public float range;
    public FactionType tagertFaction;
    public float timer;
    public float timerMax;
}